Skip to content

User Metering#10789

Open
Karuna-Mendix wants to merge 19 commits intodevelopmentfrom
kv-user-metering
Open

User Metering#10789
Karuna-Mendix wants to merge 19 commits intodevelopmentfrom
kv-user-metering

Conversation

@Karuna-Mendix
Copy link
Collaborator

@Karuna-Mendix Karuna-Mendix commented Feb 23, 2026

@Karuna-Mendix Karuna-Mendix marked this pull request as draft February 23, 2026 08:10
@Karuna-Mendix Karuna-Mendix marked this pull request as ready for review February 25, 2026 07:00
### Key Features

* Automatic tracking – User consumption is automatically tracked from the moment your app is deployed to production and becomes functional, ensuring real-time tracking.
* Monthly reporting – Usage data is collected regularly, processed monthly, and is available in the Control Center.
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As per my previous comment - maybe not yet in Control Center - 2nd PR?

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should remove reference to Control Center in this section.
Irrespective of the control center visibility, we do data collection, processing and deduplication

Copy link
Collaborator Author

@Karuna-Mendix Karuna-Mendix Mar 4, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What about - Prompt data processing: Usage data is collected, processed, and deduplicated regularly. I can keep the original sentence again when the Usage data PR is available.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Or should I remove the point completely?

### Choosing a Cross-App User Identifier:

User metering may not have been considered when your application was originally designed. As a result, different applications may store different identifier values for the same multi-app user in the `system.user.name`. Additionally, all apps in your portfolio may use different user-provisioning logic. Some apps use standard identity modules (Administration, SAML, OIDC SSO, SCIM, or LDAP) while others rely on proprietary modules or app logic to create users. This can lead to inconsistent identifiers.
Even when all apps use the same solution, for example, OIDC SSO, the technical identifier value for a multi-app user may still differ.
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JaapF @Karuna-Mendix the whole section somehow sounds very apologetic and guessing why you could have done it wrong. Documentation should be more directive IMO.

We ought to be first telling - "you are supposed to do xyz... ". These usecases when a customer might have done it wrong might be best suited for a Q&A or FAQ IMO.

What do you think?

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point.

The recommended cross-app user identifier is the enduser's email address and the recommended place to store it is in the UserCommons.namedUserIdentifier.value.

Note that an email address is personal information and the Mendix platform therefore collects hashed values of the user identifier. If you have privacy concerns, please check the data processing agreement you have with Siemens. If you don't want to use email addresses or email addresses arenot available; you have to set a guideline on what user identifier your company will be using for cross-app user identification.

The apps in your portfolio, however, may not yet be consistently storing a cross-app user identifier value.
User metering may not have been considered when your application was originally designed. As a result, different applications may store different identifier values for the same multi-app user in the system.user.name and the UserCommons.namedUserIdentifier.value may not yet be used. Applications in your portfolio may use different user-provisioning logic. Some apps use standard identity modules (Administration, SAML, OIDC SSO, SCIM, or LDAP) while others rely on proprietary modules or app logic to create users. This can lead to inconsistent identifiers. Even when all apps use the same solution, for example, OIDC SSO, the technical identifier value for a multi-app user may still differ, see section [Avoiding pairwise identifiers]

Copy link
Collaborator Author

@Karuna-Mendix Karuna-Mendix Mar 5, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @satyammx @JaapF, I tried asking Siemens GPT to improve the current section for a more directive tone. It showed the following revision to the text. Let me know if you find it useful.

Guidelines for Unique User Identification (Deduplication)
Mendix offers multi-app user licenses, which allow a single user to access multiple applications while being counted only once for metering purposes. This applies to both internal and external users. Accurate user metering and correct multi-app user deduplication depend critically on consistent user identification across all your applications.

To ensure unique multi-app users are correctly identified and metered, you must maintain a consistent user identifier across all relevant applications.

The Mendix metering mechanism uses the UserCommons.namedUserIdentifier.value attribute as the primary user identifier. If this attribute is not available or populated, it falls back to system.user.name. For a detailed overview of relevant entities and attributes, refer to the "Domain Model Entities" section.

Key Requirements for Multi-App User Identification:

Consistent Identifier Value: The same value for a given multi-app user must be stored in the chosen identifier attribute (UserCommons.namedUserIdentifier.value or system.user.name) across all applications that user accesses. Inconsistent values will result in the user being counted as multiple distinct users.

Best Practices for Choosing and Implementing a Cross-App User Identifier:

User identification strategies can vary across application portfolios, especially if applications were developed independently or use different provisioning methods. Consider the following guidelines to establish a robust and consistent identification strategy:

  1. Prioritize UserCommons.namedUserIdentifier.value: Always aim to use and populate UserCommons.namedUserIdentifier.value for user identification. This provides a dedicated field for metering purposes and offers flexibility regardless of the system.user.name value.

  2. Use a Stable, Globally Unique Identifier: Select an identifier that is stable and consistently unique across your entire user base and application portfolio.

  • Recommended: User's Email Address: Mendix strongly recommends storing the user's email address in UserCommons.namedUserIdentifier.value. This is typically a stable and globally unique identifier that users are familiar with.
  • Handling Case Sensitivity: If using email addresses or other text-based identifiers, always store these values in lowercase to prevent metering issues due to case sensitivity. The system.user.name attribute is case-sensitive by design. Mendix's standard SAML, OIDC SSO, and SCIM modules already apply this for email claims received from Identity Providers (IdPs).
  1. Address Pairwise Identifiers (e.g., OIDC sub claim): Some identity providers (like Microsoft Entra ID's OIDC sub claim) generate "pairwise" identifiers, which are unique per application for the same user. This is designed to prevent correlation across different service providers but will lead to incorrect multi-app metering within your portfolio.
    Solution for Microsoft Entra ID: If using the OIDC SSO module with Microsoft Entra ID, configure your application to store the oid claim (which contains Entra ID's user object ID) in system.user.name. The oid claim provides a consistent identifier for a multi-app user across all applications.

  2. Integrating with Existing Application Logic: If your current applications use varying system.user.name values or different provisioning methods, you can implement UserCommons.namedUserIdentifier.value without altering existing logic.
    Strategy: Continue using your existing application logic for system.user.name if necessary, but additionally implement logic to populate UserCommons.namedUserIdentifier.value with your chosen consistent cross-app identifier (e.g., email address or oid claim). This ensures the metering mechanism has a reliable, consistent identifier to use.

For more information on user types and definitions, refer to the "User Types and Definitions" section.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @Karuna-Mendix , yes I like the overall flow of the SiemensGPT text.
However one nuance got lost: the 'pair wise identifier' remark does not always apply.
Improved version:

"3. Address Pairwise Identifiers (e.g., OIDC sub claim): Some identity providers (like Microsoft Entra ID) generate "pairwise" identifiers (Entra ID's "sub" claim) , which are unique per application for the same user. This is designed to prevent correlation across different service providers but will lead to incorrect multi-app metering within your portfolio if you're using this technical identifier as the global unique identifier.
If using the OIDC SSO module with Microsoft Entra ID, you can use the oid claim (which contains Entra ID's user object ID) instead of "sub" as global unique identifier. The oid claim provides a consistent identifier for a multi-app user across all applications.
If you follow the above recommendation to use the user's email address as global unique identifier for user metering, pair-wise identifiers don't matter."

Even if all your apps are using the same user onboarding (provisioning) logic, this does not guarantee a user gets the same (technical) identifier value in all your applications.
The OpenID Connect specifications incorporate the concept of [pairwise user identifiers](https://openid.net/specs/openid-connect-core-1_0.html#PairwiseAlg). The general idea of pairwise identifiers is to prevent user correlation across apps owned by different service providers. A user gets a different value in each app when using pairwise user identifiers.

Mendix recommends storing the user’s email address in the `UserCommons.NamedUserIdentifier.value`; this ensures usage of a pairwise unique identifier in the `system.user.name` does not affect metering.
Copy link

@satyammx satyammx Mar 2, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JaapF Since we do not support UserCommons.Nam.... yet from a User Metering perspective, is it wise to call this out OR should we skip?

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JaapF Since we do not support UserCommons.Nam.... yet from a User Metering perspective, is it wise to call this out?

We've discussed this a couple of times and agreed that it's important to call this out to ensure the accuracy of the data.

### Keeping the Existing Logic and Extending

If your apps are not consistently storing the same identifier for a multi-app user in `system.user.name`, you can start using a new user attribute, new `UserCommons.namedUserIdentifier.value`.You can keep the existing application logic as it is, and in addition, store the selected user identifier value for a multi-app user in this new attribute.
If your apps are not consistently storing the same identifier for a multi-app user in `system.user.name`, you can start using a new user attribute, a new `UserCommons.namedUserIdentifier.value`.You can keep the existing application logic as it is, and in addition, store the selected user identifier value for a multi-app user in this new attribute.
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JaapF - this is not a supported entity from a User Metering perspective yet. Will lead to loss of usage data, if csutomers start implementing it.

How do you propose we move forward, considering supporting this additional attribute is not foreseen in the short term.

1. `User`: Every Mendix app has a system module containing an entity `User`.

* `system.user.name`: This field is used to identify users, unless a UserCommons.namedUserIdentifier.value is available for the same user.
* `system.user.name`: This field is used to identify users, unless a `UserCommons.namedUserIdentifier.value` is available for the same user.
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JaapF @Karuna-Mendix
UserCommons.namedUserIdentifier.value
should we refer to this attricbute since this is not yet supported by the Metering sidecar and the metering stack overall?


## Introduction

User metering provides complete visibility into the number and types of users accessing the application, ensuring compliance with the license agreement. You can see this data in the Usage Report of Control Center on the Mendix platform.
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

as per my previous comment: "complete visibility" can be mentioned only in the 2nd PR.


## Guidelines for Unique User Identification (Deduplication)

Mendix allows you to build multi-app solutions and offers a multi-app user license option. For internal users, you may have a single-app user license or a multi-app user license. External user licenses cover both single-app and multi-app users; a multi-app external user is counted only once. For more information, refer to [User types and definitions](/developerportal/deploy/licensing-apps-outside-mxcloud/#user-types-and-definitions). For accurate user metering, it is a crucial step to identify the unique multi-app user by using the same user identifier in all apps for a user.
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Given the other page that we have written i think we can trim this down to something like:

"For accurate user metering, it is a crucial step to identify the unique multi-app user by using the same user identifier in all apps for a user. Both external and internal users can be multi-app users, so consistent identification is relevant for both."


## User Classification

For accurate user metering, `External` users must be correctly classified. If they are not, your company may exceed the licensed capacity for `Internal` users, and Mendix may require you to acquire additional internal user licenses.
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's soften this here, because the metering logic is described elsewhere.
On this page it's sufficinet to say:

"For accurate user metering, External users must be explictely marked as such. If they are not, the users are counted as internal users."

### Userrole-Based User Classification

The user-role-based user classification module classifies users by using the roles already defined in your app. It can update all existing users in one run and works well if you already have separate roles for internal and external users. However, using this module requires upgrading your app to include the user classification module. For more information, refer to [User-Role-Based Classification](developerportal/deploy/populate-user-type/#user-role-based-user-classification).

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's add:

"Userrole-based user classification is the recommended approach. It encourages and leverages application design with distinct userrole definitions for external and internal users."


Within your application portfolio, the possibility to prevent cross-app user correlation is probably not needed; instead, you do want the Mendix metering system to correlate users and recognize multi-app users. Microsoft’s Entra ID uses pairwise identifiers in the OIDC `sub` claim. It is, however, possible to include the `oid` claim, which contains the same value for a given multi-app user across all applications; Entra ID’s `object-id`. Mendix recommends storing the `oid` claim in the `system.user.name` if you are using the OIDC SSO module with Entra ID.

### Keeping the Existing Logic and Extending
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Given satyam's comment about first clearly stating guidance and after that explain in more detail I think we need to start this section with clear guidance, rather than "If your apps..."

"The recommended entity attribute to store cross-app user identifiers is the UserCommons.namedUserIdentifier.value. This allows you keep the existing application logic as it is, and in addition, store the selected user identifier value for a multi-app user in this attribute. If your applications are already consistently storing the same identifier for a multi-app user in system.user.name, you don't have to use the UserCommons.namedUserIdentifier.value."

I thin k this is more positive wording.

### Choosing a Cross-App User Identifier:

User metering may not have been considered when your application was originally designed. As a result, different applications may store different identifier values for the same multi-app user in the `system.user.name`. Additionally, all apps in your portfolio may use different user-provisioning logic. Some apps use standard identity modules (Administration, SAML, OIDC SSO, SCIM, or LDAP) while others rely on proprietary modules or app logic to create users. This can lead to inconsistent identifiers.
Even when all apps use the same solution, for example, OIDC SSO, the technical identifier value for a multi-app user may still differ.
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @Karuna-Mendix , yes I like the overall flow of the SiemensGPT text.
However one nuance got lost: the 'pair wise identifier' remark does not always apply.
Improved version:

"3. Address Pairwise Identifiers (e.g., OIDC sub claim): Some identity providers (like Microsoft Entra ID) generate "pairwise" identifiers (Entra ID's "sub" claim) , which are unique per application for the same user. This is designed to prevent correlation across different service providers but will lead to incorrect multi-app metering within your portfolio if you're using this technical identifier as the global unique identifier.
If using the OIDC SSO module with Microsoft Entra ID, you can use the oid claim (which contains Entra ID's user object ID) instead of "sub" as global unique identifier. The oid claim provides a consistent identifier for a multi-app user across all applications.
If you follow the above recommendation to use the user's email address as global unique identifier for user metering, pair-wise identifiers don't matter."

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants